#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
#include <stdio.h>
	int main()
	{
		int n = 0;
		scanf("%d", &n);
		int a = 0, b = 0, c = 0;
		int count = 0;
		while (scanf("%d %d %d\n", &a, &b, &c) != EOF)
		{
			if (a + b + c < 180)
			{
				count++;
			}
		}
		printf("%d", count);
		return 0;
	}
	return 0;
}
#include <stdio.h>
int main()
{
	int i = 0;
	int count = 0;
	for (i = 1; i <= 2019; i++)
	{
		if (i % 10 == 9 || i / 10 % 10 == 9 || i / 100 % 10 == 9)
		{
			count++;
		}
	}
	printf("%d", count);
	return 0;
}